<template>
    <div class="app-container">
        <el-form :model="queryParams" ref="queryFormRef" :inline="true" v-show="showSearch" label-width="90px">
            <el-row>
                <el-col :span="13">
                    <el-form-item label="状态：" prop="selectStatus">
                        <el-radio-group v-model="selectStatus" size="medium" text-color="white" fill="rgba(129,179,55,0.9)"
                            class="custom-radio-group" @change="handleQuery">
                            <el-radio-button label="全部">
                                <span>全部 ({{ quanbutotal }})</span>
                            </el-radio-button>
                            <el-radio-button label="审核中" v-hasPermi="['agriculture:process:shenhezhong']">
                                <span>审核中 ({{ shenhetotal }})</span>
                            </el-radio-button>
                            <el-radio-button label="待处理">
                                <span>待处理 ({{ daichutotal }})</span>

                            </el-radio-button>
                            <el-radio-button label="已处理" v-hasPermi="['agriculture:process:yichuli']">
                                <span>已处理 ({{ yichulitotal }})</span>
                            </el-radio-button>
                            <el-radio-button label="异常" v-hasPermi="['agriculture:process:yichang']">
                                <span>异常 ({{ yichangtotal }})</span>
                            </el-radio-button>
                        </el-radio-group>
                    </el-form-item>
                </el-col>
                <el-col :span="11" style="float:right;margin:0">
                    <!-- 村级 -->
                    <el-form-item size="large" style="float:right;margin:0">
                        <el-button :loading="buttonLoading" type="primary" @click="submitPending" v-show="!isAdmin"
                            v-hasPermi="['agriculture:process:subpend']">一键提交待处理</el-button>
                    </el-form-item>

                    <!-- 乡级 -->
                    <el-form-item size="large" style="float:right;margin:0" v-show='showProducerColumns'>
                        <el-button :loading="buttonLoading" type="primary" @click="geTownCheck" v-show="!isAdmin"
                            v-hasPermi="['agriculture:process:townCheck']">生成生产者核查函</el-button>
                    </el-form-item>
                    <el-form-item size="large" style="float:right;margin:0" v-show='showFarmLandColumns'>
                        <el-button :loading="buttonLoading" type="primary" @click="geTownCheckFarm" v-show="!isAdmin"
                            v-hasPermi="['agriculture:process:geTownRe']">生成耕地地力核查函</el-button>
                    </el-form-item>
                    <el-form-item size="large" style="float:right;margin:0" v-show='showCropFarmLandColumns'>
                        <el-button :loading="buttonLoading" type="primary" @click="geTownCheckCropFarm" v-show="!isAdmin"
                            v-hasPermi="['agriculture:process:geTownRe']">生成耕地轮作核查函</el-button>
                    </el-form-item>

                    <el-form-item size="large" style="float:right;margin:0" v-show='showHighProteinColumns'>
                        <el-button :loading="buttonLoading" type="primary" @click="geTownRequestDan" v-show="!isAdmin"
                            v-hasPermi="['agriculture:process:geTownRe']">生成高蛋白大豆审核函</el-button>
                    </el-form-item>

                    <el-form-item size="large" style="float:right;margin:0" v-show='showHighOilColumns'>
                        <el-button :loading="buttonLoading" type="primary" @click="geTownRequestYou" v-show="!isAdmin"
                            v-hasPermi="['agriculture:process:geTownRe']">生成高油大豆核查函</el-button>
                    </el-form-item>
                    <el-form-item size="large" style="float:right;">
                        <el-button :loading="buttonLoading" type="danger" plain @click="townRejectAll" v-show="!isAdmin"
                            v-hasPermi="['agriculture:process:townReject']">一键驳回</el-button>
                    </el-form-item>
                    <el-form-item size="large" style="float:right;">
                        <el-button :loading="buttonLoading" type="success" :disabled="multiple" @click="townApproveAll"
                            v-show="!isAdmin" v-hasPermi="['agriculture:process:townReject']">一键处理</el-button>
                    </el-form-item>

                    <!-- 区级 -->
                    <el-form-item size="large" style="float:right;margin:0" v-show='showProducerColumns'>
                        <el-button :loading="buttonLoading" type="primary" @click="geDistrictCheck"
                            v-hasPermi="['agriculture:process:disCheck']">生成生产者核查函</el-button>
                    </el-form-item>
                    <el-form-item size="large" style="float:right;margin:0" v-show='showHighProteinColumns'>
                        <el-button :loading="buttonLoading" type="primary" @click="geDisRequestDan"
                            v-hasPermi="['agriculture:process:geDisRe']">生成高蛋白大豆核查函</el-button>
                    </el-form-item>
                    <el-form-item size="large" style="float:right;margin:0" v-show='showHighOilColumns'>
                        <el-button :loading="buttonLoading" type="primary" @click="geDisRequestYou"
                            v-hasPermi="['agriculture:process:geDisRe']">生成高油大豆核查函</el-button>
                    </el-form-item>
                    <el-form-item size="large" style="float:right;margin:0" v-show='showFarmLandColumns'>
                        <el-button :loading="buttonLoading" type="primary" @click="geDistrictCheckFarm"
                            v-hasPermi="['agriculture:process:geDisRe']">生成耕地地力核查函</el-button>
                    </el-form-item>
                    <el-form-item size="large" style="float:right;margin:0" v-show='showCropFarmLandColumns'>
                        <el-button :loading="buttonLoading" type="primary" @click="geDistrictCheckCropFarm"
                            v-hasPermi="['agriculture:process:geDisRe']">生成耕地轮作核查函</el-button>
                    </el-form-item>
                    <el-form-item size="large" style="float:right">
                        <el-button :loading="buttonLoading" type="danger" plain @click="disRejectAll"
                            v-hasPermi="['agriculture:process:disReject']">一键驳回</el-button>
                    </el-form-item>

                </el-col>
            </el-row>
            <el-row>
                <el-col :span="12">
                    <el-form-item label="身份证号码:" prop="idCard" style="margin:0">
                        <el-input v-model="queryParams.idCard" placeholder="请输入身份证号码" clearable size="small"
                            @keyup.enter.native="handleQuery" />
                    </el-form-item>
                    <el-form-item label="一卡通号码:" prop="bankCard" style="margin:0">
                        <el-input v-model="queryParams.bankCard" placeholder="请输入一卡通号码" clearable size="small"
                            @keyup.enter.native="handleQuery" />
                    </el-form-item>
                </el-col>
                <el-col :span="4">
                    <el-form-item>
                        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
                        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery()">重置</el-button>
                    </el-form-item>
                </el-col>
                <el-col :span="3" v-hasPermi="['agriculture:process:siftTown']" style="float: right;margin:0">
                    <el-form-item prop="townName" label-width="20px">
                        <el-select placeholder="全部乡" v-model="queryParams.townName" @change="handleQuery" clearable
                            class="typeDiv" :style="{ width: '100%' }" size="small">
                            <el-option v-for="item in townOptions" :key="item.id" :label="item.label" :value="item.label">
                            </el-option>
                        </el-select>
                    </el-form-item>
                </el-col>

                <el-col :span="3" v-hasPermi="['agriculture:process:siftVillage']" style="float: right;margin:0">
                    <el-form-item prop="villageName" label-width="20px">
                        <el-select placeholder="全部村" v-model="queryParams.villageName" @change="handleQuery" size="small"
                            v-show="!isAdmin" clearable class="typeDiv" :style="{ width: '100%' }">
                            <el-option v-for="item in villageOptions" :key="item.value" :label="item.label"
                                :value="item.label">
                            </el-option>
                        </el-select>
                    </el-form-item>
                </el-col>
            </el-row>
            <el-row>
                <el-col :span="16" style="color:#0F40F5;font-size: 20px;" v-hasPermi="['agriculture:subsidy:disSum']"
                    v-if='!queryParams.townName'>
                    <el-form-item prop="straName" label-width="20px">
                        <!-- 区总面积 -->
                        <span v-if="showProducerColumns">{{ queryParams.straName }}总补贴面积：{{ sumData.scqutbyotal
                        }}亩（玉米总补贴面积：{{ sumData.yubyqutotal }}亩，大豆总补贴面积：{{ sumData.dadoubyqutotal }}亩，稻谷总补贴面积：{{
    sumData.gubyqutotal }}亩）</span>
                        <span v-if="showHighProteinColumns">{{ queryParams.straName }}总补贴面积：{{
                            sumData.youdouGaodanbaibyqutotal
                        }}亩</span>
                        <span v-if="showHighOilColumns">{{ queryParams.straName }}总补贴面积：{{ sumData.youdouGaoyoubyqutotal
                        }}亩</span>
                        <span v-if="showFarmLandColumns">{{ queryParams.straName }}总补贴面积：{{ sumData.farmlandbyqutotal
                        }}亩</span>
                        <span v-if="showCropFarmLandColumns">{{ queryParams.straName }}总补贴面积：{{ sumData.cropallbyqu
                        }}亩</span>

                    </el-form-item>
                </el-col>

                <el-col :span="16" style="color:#0F40F5;font-size: 20px;" v-hasPermi="['agriculture:subsidy:townSum']"
                    v-if='!queryParams.villageName' v-show="queryParams.townName">
                    <el-form-item prop="townName" label-width="20px">
                        <span v-if="showProducerColumns">{{ queryParams.townName }}总补贴面积：{{ sumData.scbyxitotal
                        }}亩（玉米总补贴面积：{{ sumData.yubyxitotal }}亩，大豆总补贴面积：{{ sumData.dadoubyxitotal }}亩，稻谷总补贴面积：{{
    sumData.gubyxitotal }}亩）</span>
                        <span v-if="showHighProteinColumns">{{ queryParams.townName }}总补贴面积：{{
                            sumData.youdouGaodanbaibyxitotal
                        }}亩</span>
                        <span v-if="showHighOilColumns">{{ queryParams.townName }}总补贴面积：{{ sumData.youdouGaoyoubyxitotal
                        }}亩</span>
                        <span v-if="showFarmLandColumns">{{ queryParams.townName }}总补贴面积：{{ sumData.farmlandbyxitotal
                        }}亩</span>
                        <span v-if="showCropFarmLandColumns">{{ queryParams.townName }}总补贴面积：{{ sumData.cropallbyxi
                        }}亩</span>
                    </el-form-item>
                </el-col>

                <el-col :span="16" style="color:#0F40F5;font-size: 20px;" v-hasPermi="['agriculture:subsidy:villSum']"
                    v-if="queryParams.villageName">
                    <el-form-item prop="villageName" label-width="20px">
                        <span v-if="showProducerColumns">{{ queryParams.villageName }}总补贴面积：{{ sumData.scbycuntotal
                        }}亩（玉米总补贴面积：{{ sumData.yubycuntotal }}亩，大豆总补贴面积：{{ sumData.dadoubycuntotal }}亩，稻谷总补贴面积：{{
    sumData.gubycuntotal }}亩）</span>
                        <span v-if="showHighProteinColumns">{{ queryParams.villageName
                        }}总补贴面积：{{ sumData.youdouGaodanbaibycuntotal }}亩</span>
                        <span v-if="showHighOilColumns">{{ queryParams.villageName }}总补贴面积：{{
                            sumData.youdouGaoyoubycuntotal }}亩</span>
                        <span v-if="showFarmLandColumns">{{ queryParams.villageName }}总补贴面积：{{ sumData.farmlandbycuntotal
                        }}亩</span>
                        <span v-if="showCropFarmLandColumns">{{ queryParams.villageName }}总补贴面积：{{ sumData.cropallbycun
                        }}亩</span>
                    </el-form-item>
                </el-col>

                <el-col :span="3" v-if="rejectButton" v-hasPermi="['agriculture:process:townCheck']">
                    <el-form-item size="medium">
                        <el-button :loading="buttonLoading" type="primary" @click="viewReject">区级驳回理由</el-button>
                    </el-form-item>
                </el-col>
                <el-col :span="3" v-hasPermi="['agriculture:process:viewTownRe']">
                    <el-form-item size="medium">
                        <el-button v-if="true" :loading="buttonLoading" type="primary"
                            @click="viewTownCheck">查看乡级核查函</el-button>
                    </el-form-item>
                </el-col>
                <el-col :span="3" style="float: right;margin:0">
                    <el-form-item prop="appType" label-width="20px">
                        <el-select v-model="queryParams.appType" @change="handleQuery" size="small" class="typeDiv"
                            :style="{ width: '100%' }">
                            <el-option v-for="item in subsidyOptions" :label="item.label" :value="item.value">
                            </el-option>
                        </el-select>
                    </el-form-item>
                </el-col>
            </el-row>
        </el-form>

        <!-- 区级驳回理由的填写 -->
        <el-dialog :title="disRejTitle" :visible.sync="disRejDialog">
            <el-form :model="disRejform">
                <el-form-item>
                    <el-input v-model="disRejform.abnormal" type="textarea" placeholder="请输入驳回理由"
                        :autosize="{ minRows: 4, maxRows: 8 }" :style="{ width: '100%' }"></el-input>
                </el-form-item>

            </el-form>
            <div slot="footer" class="dialog-footer">
                <el-button @click="disRejDialog = false">取 消</el-button>
                <el-button type="primary" @click="submitDisRej">确 定</el-button>
            </div>
        </el-dialog>

        <el-row :gutter="10" class="mb8">
            <!-- 生产者表 -->
            <el-table v-loading="tableLoading" ref="produceTable" fit :data="list"
                @selection-change="handleSelectionChange">
                <el-table-column type="selection" width="55" align="center" />
                <el-table-column label="工单编号" align="center" prop="appNum" width="80" />
                <el-table-column label="申请人" align="center" prop="appyBy" width="80" />
                <el-table-column label="乡" align="center" prop="townName" width="80" />
                <el-table-column label="村" align="center" prop="villageName" width="80" />

                <el-table-column label="身份证号码" align="center" prop="idCard" />
                <el-table-column label="一卡通号码" align="center" prop="bankCard" />
                <el-table-column label="状态" align="center" prop="statusShow">
                    <template slot-scope="scope">
                        <el-tag type="success" v-if="scope.row.statusShow === '已处理'">已处理</el-tag>
                        <el-tag type="warning" v-if="scope.row.statusShow === '审核中'">审核中</el-tag>
                        <el-tag type="primary" v-if="scope.row.statusShow === '待处理'">待处理</el-tag>
                        <el-tag type="danger" v-if="scope.row.statusShow === '异常'">异常</el-tag>
                    </template>
                </el-table-column>
                <template v-if='showProducerColumns'>
                    <el-table-column label="玉米补贴面积(亩)" width="80" key="1" align="center" prop="yumiareaAmount" />
                    <el-table-column label="大豆补贴面积(亩)" width="80" key="2" align="center" prop="dadouareaAmount" />
                    <el-table-column label="稻谷补贴面积(亩)" width="80" key="3" align="center" prop="daoguheareaAmount" />
                    <el-table-column label="地表水(亩)" width="80" key="4" align="center" prop="daogudibiareaAmount" />
                    <el-table-column label="地下水(亩)" width="80" key="5" align="center" prop="daogudixiaareaAmount" />
                </template>
                <template v-if='showHighProteinColumns'>
                    <el-table-column label="高蛋白大豆补贴面积" key="6" align="center" prop="areaAmountdouGaodanbai" />
                </template>
                <template v-if='showHighOilColumns'>
                    <el-table-column label="高油大豆补贴面积" key="7" align="center" prop="areaAmountdouGaoyou" />
                </template>
                <template v-if='showFarmLandColumns'>
                    <el-table-column label="耕地地力补贴面积" key="8" align="center" prop="farmlandareaAmount" />
                </template>

                <template v-if='showCropFarmLandColumns'>
                    <el-table-column label="第一种轮作补贴面积" key="21" align="center" prop="curallone" />
                    <el-table-column label="第二种轮作补贴面积" key="22" align="center" prop="curalltwo" />
                    <el-table-column label="第三种轮作补贴面积" key="23" align="center" prop="curallthree" />
                    <el-table-column label="第四种轮作补贴面积" key="24" align="center" prop="curallfour" />
                    <el-table-column label="总轮作补贴面积" key="25" align="center" prop="cropall" />
                </template>
                <el-table-column label="当前流程" align="center" prop="nodeName" width="100" />
                <!-- 生产者查看审批 -->
                <template v-if='showProducerColumns'>
                    <el-table-column label="操作" align="center" class-name="small-padding" key="9" width="100">
                        <template slot-scope="scope">
                            <el-button type="text" size="mini" @click="updateProduce(scope.row)"
                                v-hasPermi="['agriculture:process:villView']">查看</el-button> <!--村干部看 -->
                                <el-button type="text" size="mini" @click="deleteProduce(scope.row)"
                                v-hasPermi="['agriculture:process:villView']">删除</el-button> <!--村干部看 -->

                            <el-button type="text" size="mini" @click="handleRejectProduce(scope.row)"
                                v-hasPermi="['agriculture:process:reject']">审核</el-button>
                        </template>
                    </el-table-column>
                </template>
                <!-- 耕地地力审批 -->
                <template v-if='showFarmLandColumns'>
                    <el-table-column label="操作" align="center" class-name="small-padding" key="10" width="100">
                        <template slot-scope="scope">
                            <el-button type="text" size="mini" @click="updateFarmland(scope.row)"
                                v-hasPermi="['agriculture:process:villView']">查看</el-button> <!--村干部看 -->
                                <el-button type="text" size="mini" @click="deleteProduce(scope.row)"
                                v-hasPermi="['agriculture:process:villView']">删除</el-button> <!--村干部看 -->

                            <el-button type="text" size="mini" @click="handleRejectFarmland(scope.row)"
                                v-hasPermi="['agriculture:process:reject']">审核</el-button>
                        </template>
                    </el-table-column>
                </template>
                <!-- 耕地轮作审批 -->
                <template v-if='showCropFarmLandColumns'>
                    <el-table-column label="操作" align="center" class-name="small-padding" key="10" width="100">
                        <template slot-scope="scope">
                            <el-button type="text" size="mini" @click="updateCropFarmland(scope.row)"
                                v-hasPermi="['agriculture:process:villView']">查看</el-button> <!--村干部看 -->
                                <el-button type="text" size="mini" @click="deleteProduce(scope.row)"
                                v-hasPermi="['agriculture:process:villView']">删除</el-button> <!--村干部看 -->

                            <el-button type="text" size="mini" @click="handleRejectCropFarmland(scope.row)"
                                v-hasPermi="['agriculture:process:reject']">审核</el-button>
                        </template>
                    </el-table-column>
                </template>
                <!-- 高蛋白大豆查看审批 -->
                <template v-if='showHighProteinColumns'>
                    <el-table-column label="操作" align="center" class-name="small-padding" key="11">
                        <template slot-scope="scope">
                            <el-button type="text" size="mini" @click="updateProsoy(scope.row)"
                                v-hasPermi="['agriculture:process:villView']">查看</el-button> <!--村干部看 -->
                                <el-button type="text" size="mini" @click="deleteProduce(scope.row)"
                                v-hasPermi="['agriculture:process:villView']">删除</el-button> <!--村干部看 -->

                            <el-button type="text" size="mini" @click="handleRejectProsoy(scope.row)"
                                v-hasPermi="['agriculture:process:reject']">审核</el-button>
                        </template>
                    </el-table-column>
                </template>
                <template v-if='showHighProteinColumns'>
                    <el-table-column label="Excel" align="center" class-name="small-padding" key="12">
                        <template slot-scope="scope">
                            <el-button type="text" size="mini" @click="handleExportDan(scope.row)">导出</el-button>
                        </template>
                    </el-table-column>
                </template>


                <template v-if='showHighOilColumns'>
                    <el-table-column label="操作" align="center" class-name="small-padding" key="13">
                        <template slot-scope="scope">
                            <el-button type="text" size="mini" @click="updateOilsoy(scope.row)"
                                v-hasPermi="['agriculture:process:villView']">查看</el-button> <!--村干部看 -->
                                <el-button type="text" size="mini" @click="deleteProduce(scope.row)"
                                v-hasPermi="['agriculture:process:villView']">删除</el-button> <!--村干部看 -->

                            <el-button type="text" size="mini" @click="handleRejectOilsoy(scope.row)"
                                v-hasPermi="['agriculture:process:reject']">审核</el-button>
                        </template>
                    </el-table-column>
                </template>
                <!-- 高油大豆查看审批 -->
                <template v-if='showHighOilColumns'>
                    <el-table-column label="Excel" align="center" class-name="small-padding" key="14">
                        <template slot-scope="scope">
                            <el-button type="text" size="mini" @click="handleExportYou(scope.row)">导出</el-button>
                        </template>
                    </el-table-column>
                </template>
            </el-table>
            <pagination v-show="quanbutotal > 0" :total="quanbutotal" :page.sync="queryParams.pageNum"
                :limit.sync="queryParams.pageSize" @pagination="getList" />
        </el-row>

        <!-- 审批生产者抽屉 -->
        <el-drawer :title="title" :visible.sync="produceDialog" :with-header="false" direction="rtl" size="60%"
            custom-class="demo-drawer">
            <div class="demo-drawer__content">
                <el-form ref="produceRef" :model="rejProduceForm" size="medium" label-width="130px" label-position="left">
                    <div class="card-container">
                        <el-card class="infoDiv">
                            <span class="corner-label">基本信息</span>
                            <el-row :gutter="24">
                                <el-col :span="12">
                                    <el-form-item label="身份证号码" prop="idCard">
                                        <el-input :disabled="true" v-model="rejProduceForm.idCard" :maxlength="18"
                                            :style="{ width: '100%' }"></el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="12">
                                    <el-form-item label="申请人" prop="appyBy">
                                        <el-input :disabled="true" v-model="rejProduceForm.appyBy"
                                            :style="{ width: '100%' }">
                                        </el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row :gutter="24">
                                <el-col :span="6">
                                    <el-form-item label="性别" prop="sex" label-width="40px">
                                        <el-input :disabled="true" v-model="rejProduceForm.sex" :style="{ width: '100%' }">
                                        </el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="6">
                                    <el-form-item label="年龄" prop="age" label-width="40px">
                                        <el-input :disabled="true" v-model="rejProduceForm.age"
                                            :style="{ width: '100%' }"></el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="12">
                                    <el-form-item label="身份证地址" prop="idcardAddr">
                                        <el-input :disabled="true" v-model="rejProduceForm.idCardAddr"
                                            :style="{ width: '100%' }"></el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row :gutter="24">
                                <el-col :span="12">
                                    <el-form-item label="现住地址" prop="oftenAddr">
                                        <el-input :disabled="true" v-model="rejProduceForm.oftenAddr"
                                            :style="{ width: '100%' }">
                                        </el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="12">
                                    <el-form-item label="联系方式" prop="phone">
                                        <el-input :disabled="true" v-model="rejProduceForm.phone" :maxlength="11"
                                            :style="{ width: '100%' }"></el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row :gutter="24">
                                <el-col :span="16">
                                    <el-form-item label="一卡通账号" prop="bankCard">
                                        <el-input :disabled="true" v-model="rejProduceForm.bankCard" show-word-limit
                                            :style="{ width: '100%' }"></el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                        </el-card>
                    </div>
                    <div class="card-container">
                        <el-card class="infoDiv">
                            <span class="corner-label">补贴类型</span>
                            <el-row :gutter="24">
                                <el-col :span="12">
                                    <el-form-item label="玉米种植补贴面积" prop="yumiareaAmount">
                                        <el-input :disabled="true" v-model="rejProduceForm.yumiareaAmount" show-word-limit
                                            :style="{ width: '100%' }">
                                            <template slot="append">亩</template>
                                        </el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="12" :style="{ width: '100%' }"></el-col>
                            </el-row>
                            <el-row :gutter="24">
                                <el-col :span="12">
                                    <el-form-item label="大豆种植补贴面积" prop="dadouareaAmount">
                                        <el-input :disabled="true" v-model="rejProduceForm.dadouareaAmount" show-word-limit
                                            :style="{ width: '100%' }">
                                            <template slot="append">亩</template>
                                        </el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="12" :style="{ width: '100%' }"></el-col>
                            </el-row>
                            <el-row :gutter="24">
                                <el-col :span="4">
                                    <el-form-item label="稻谷种植补贴面积" prop="areaAmount">
                                    </el-form-item>
                                </el-col>
                                <el-col :span="7">
                                    <el-form-item label="地表水" prop="daogudibiareaAmount" label-width="60px">
                                        <el-input :disabled="true" v-model="rejProduceForm.daogudibiareaAmount"
                                            :style="{ width: '100%' }">
                                            <template slot="append">亩</template>
                                        </el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="7">
                                    <el-form-item label="地下水" prop="daogudixiaareaAmount" label-width="60px">
                                        <el-input :disabled="true" v-model="rejProduceForm.daogudixiaareaAmount"
                                            :style="{ width: '100%' }">
                                            <template slot="append">亩</template>
                                        </el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="6">
                                    <el-form-item label="合计" prop="daoguheareaAmount" label-width="40px">
                                        <el-input :disabled="true" v-model="rejProduceForm.daoguheareaAmount" type="number"
                                            :style="{ width: '100%' }">
                                            <template slot="append">亩</template>
                                        </el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row :gutter="24">
                                <el-col :span="24">
                                    <el-form-item label="合计种植补贴面积" prop="areaAmount">
                                        <el-input :disabled="true" v-model="rejProduceForm.areaAmount"
                                            :style="{ width: '50%' }">
                                            <template slot="append">亩</template>
                                        </el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                        </el-card>
                    </div>
                    <div class="card-container">
                        <el-card class="infoDiv">
                            <span class="corner-label" style="background-color:rgb(234, 183, 225)">驳回理由</span>
                            <el-row :gutter="24">
                                <el-col :span="24">
                                    <el-form-item>
                                        <el-button @click="approveApply">通过申请</el-button>
                                        <el-button @click="rejectApply">驳回申请</el-button>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row :gutter="12">
                                <el-col :span="24">
                                    <el-form-item label="驳回理由" prop="abnormal" label-width="80px">
                                        <el-input v-model="rejProduceForm.abnormal" type="textarea" placeholder="请输入驳回理由"
                                            :disabled="isDisabled" :autosize="{ minRows: 4, maxRows: 8 }"
                                            :style="{ width: '100%' }"></el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                        </el-card>
                    </div>
                </el-form>
                <div class="demo-drawer__footer">
                    <el-button @click="cancelProduceForm">取 消</el-button>
                    <el-button type="primary" @click="submitProduceForm" :loading="drawerLoading">确定</el-button>
                </div>
            </div>
        </el-drawer>

        <!-- 审批耕地地力抽屉 -->
        <el-drawer :title="title" :visible.sync="farmlandDialog" :with-header="false" direction="rtl" size="60%"
            custom-class="demo-drawer">
            <div class="demo-drawer__content">
                <el-form ref="farmlandRef" :model="rejFarmlandForm" size="medium" label-width="130px" label-position="left">
                    <div class="card-container">
                        <el-card class="infoDiv">
                            <span class="corner-label">基本信息</span>
                            <el-row :gutter="24">
                                <el-col :span="12">
                                    <el-form-item label="身份证号码" prop="idCard">
                                        <el-input :disabled="true" v-model="rejFarmlandForm.idCard" :maxlength="18"
                                            :style="{ width: '100%' }"></el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="12">
                                    <el-form-item label="申请人" prop="appyBy">
                                        <el-input :disabled="true" v-model="rejFarmlandForm.appyBy"
                                            :style="{ width: '100%' }">
                                        </el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row :gutter="24">
                                <el-col :span="6">
                                    <el-form-item label="性别" prop="sex" label-width="40px">
                                        <el-input :disabled="true" v-model="rejFarmlandForm.sex" :style="{ width: '100%' }">
                                        </el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="6">
                                    <el-form-item label="年龄" prop="age" label-width="40px">
                                        <el-input :disabled="true" v-model="rejFarmlandForm.age"
                                            :style="{ width: '100%' }"></el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="12">
                                    <el-form-item label="身份证地址" prop="idcardAddr">
                                        <el-input :disabled="true" v-model="rejFarmlandForm.idCardAddr"
                                            :style="{ width: '100%' }"></el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row :gutter="24">
                                <el-col :span="12">
                                    <el-form-item label="现住地址" prop="oftenAddr">
                                        <el-input :disabled="true" v-model="rejFarmlandForm.oftenAddr"
                                            :style="{ width: '100%' }">
                                        </el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="12">
                                    <el-form-item label="联系方式" prop="phone">
                                        <el-input :disabled="true" v-model="rejFarmlandForm.phone" :maxlength="11"
                                            :style="{ width: '100%' }"></el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row :gutter="24">
                                <el-col :span="16">
                                    <el-form-item label="一卡通账号" prop="bankCard">
                                        <el-input :disabled="true" v-model="rejFarmlandForm.bankCard" show-word-limit
                                            :style="{ width: '100%' }"></el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                        </el-card>
                    </div>
                    <div class="card-container">
                        <el-card class="infoDiv">
                            <span class="corner-label">补贴类型</span>
                            <el-row :gutter="24" style="margin-bottom: 10px; margin-top: 10px;">
                                <el-col :span="14">
                                    <el-form-item label="耕地地力补贴面积" prop="farmlandareaAmount" label-width="160px">
                                        <el-input :disabled="true" v-model="rejFarmlandForm.farmlandareaAmount"
                                            :style="{ width: '100%' }">
                                            <template slot="append">亩</template>
                                        </el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                        </el-card>
                    </div>
                    <div class="card-container">
                        <el-card class="infoDiv">
                            <span class="corner-label" style="background-color:rgb(234, 183, 225)">驳回理由</span>
                            <el-row :gutter="24">
                                <el-col :span="24">
                                    <el-form-item>
                                        <el-button @click="approveApply">通过申请</el-button>
                                        <el-button @click="rejectApply">驳回申请</el-button>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row :gutter="12">
                                <el-col :span="24">
                                    <el-form-item label="驳回理由" prop="abnormal" label-width="80px">
                                        <el-input v-model="rejFarmlandForm.abnormal" type="textarea" placeholder="请输入驳回理由"
                                            :disabled="isDisabled" :autosize="{ minRows: 4, maxRows: 8 }"
                                            :style="{ width: '100%' }"></el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                        </el-card>
                    </div>
                </el-form>
                <div class="demo-drawer__footer">
                    <el-button @click="cancelFarmlandForm">取 消</el-button>
                    <el-button type="primary" @click="submitFarmlandForm" :loading="drawerLoading">确定</el-button>
                </div>
            </div>
        </el-drawer>
        <!-- 审批耕地轮作抽屉 -->
        <el-drawer :title="title" :visible.sync="cropfarmlandDialog" :with-header="false" direction="rtl" size="60%"
            custom-class="demo-drawer">
            <div class="demo-drawer__content">
                <el-form ref="cropfarmlandRef" :model="rejCropFarmlandForm" size="medium" label-width="130px"
                    label-position="left">
                    <div class="card-container">
                        <el-card class="infoDiv">
                            <span class="corner-label">基本信息</span>
                            <el-row :gutter="24">
                                <el-col :span="12">
                                    <el-form-item label="身份证号码" prop="idCard">
                                        <el-input :disabled="true" v-model="rejCropFarmlandForm.idCard" :maxlength="18"
                                            :style="{ width: '100%' }"></el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="12">
                                    <el-form-item label="申请人" prop="appyBy">
                                        <el-input :disabled="true" v-model="rejCropFarmlandForm.appyBy"
                                            :style="{ width: '100%' }">
                                        </el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row :gutter="24">
                                <el-col :span="6">
                                    <el-form-item label="性别" prop="sex" label-width="40px">
                                        <el-input :disabled="true" v-model="rejCropFarmlandForm.sex"
                                            :style="{ width: '100%' }">
                                        </el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="6">
                                    <el-form-item label="年龄" prop="age" label-width="40px">
                                        <el-input :disabled="true" v-model="rejCropFarmlandForm.age"
                                            :style="{ width: '100%' }"></el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="12">
                                    <el-form-item label="身份证地址" prop="idcardAddr">
                                        <el-input :disabled="true" v-model="rejCropFarmlandForm.idCardAddr"
                                            :style="{ width: '100%' }"></el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row :gutter="24">
                                <el-col :span="12">
                                    <el-form-item label="现住地址" prop="oftenAddr">
                                        <el-input :disabled="true" v-model="rejCropFarmlandForm.oftenAddr"
                                            :style="{ width: '100%' }">
                                        </el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="12">
                                    <el-form-item label="联系方式" prop="phone">
                                        <el-input :disabled="true" v-model="rejCropFarmlandForm.phone" :maxlength="11"
                                            :style="{ width: '100%' }"></el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row :gutter="24">
                                <el-col :span="16">
                                    <el-form-item label="一卡通账号" prop="bankCard">
                                        <el-input :disabled="true" v-model="rejCropFarmlandForm.bankCard" show-word-limit
                                            :style="{ width: '100%' }"></el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                        </el-card>
                    </div>
                    <div class="card-container">
                        <el-card class="infoDiv">
                            <span class="corner-label">轮作方式选择</span>
                            <el-row :gutter="24" style="margin-bottom: 10px; margin-top: 10px;">
                                <el-col :span="24">
                                    <el-form-item label="轮作方式" label-width="100px" prop="lunzuoapplytype">
                                        <el-checkbox-group :disabled="true" v-model="rejCropFarmlandForm.lunzuoapplytype">
                                            <div v-for="(type, index) in rotationTypeOptions" :key="type.value">
                                                <el-checkbox :label="type.value">
                                                    {{ type.label }}
                                                </el-checkbox>
                                            </div>

                                        </el-checkbox-group>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row :gutter="24" style="margin-bottom: 10px; margin-top: 10px;">
                                <el-col :span="24">
                                    <el-form-item label-width="200px" :label="`${year}年合计轮作补贴面积`" prop="cropall">
                                        <el-input :disabled="true" v-model="rejCropFarmlandForm.cropall"
                                            :style="{ width: '100%' }">
                                            <template slot="append">亩</template>
                                        </el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row :gutter="24" style="margin-bottom: 10px; margin-top: 10px;">
                                <el-col :span="24">
                                    <el-form-item label="备注" prop="remark">
                                        <el-input :disabled="true" v-model="rejCropFarmlandForm.remark" type="textarea"
                                            :autosize="{ minRows: 1, maxRows: 4 }" :style="{ width: '100%' }"></el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>

                        </el-card>
                    </div>
                    <div class="card-container" v-if="rejCropFarmlandForm.lunzuoapplytype.includes(1)">
                        <el-card class="infoDiv">
                            <span class="corner-label">第一种轮作</span>
                            <el-row :gutter="24" style="margin-bottom: 10px; margin-top: 10px;">
                                <el-col :span="12">
                                    <el-form-item label-width="200px" :label="`${preyear}年玉米种植面积`" prop="preyuone">
                                        <el-input :disabled="true" v-model="rejCropFarmlandForm.preyuone" type="number"
                                            :style="{ width: '100%' }">
                                            <template slot="append">亩</template>
                                        </el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="12">
                                    <el-form-item label-width="200px" :label="`${preyear}年小麦种植面积`" prop="prexiaoone">
                                        <el-input :disabled="true" v-model="rejCropFarmlandForm.prexiaoone" type="number"
                                            :style="{ width: '100%' }">
                                            <template slot="append">亩</template>
                                        </el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="12" :style="{ width: '100%' }"></el-col>
                            </el-row>
                            <el-row :gutter="24" style="margin-bottom: 10px; margin-top: 10px;">
                                <el-col :span="12">
                                    <el-form-item label-width="200px" :label="`${preyear}年薯类补贴面积`" prop="preshuone">
                                        <el-input :disabled="true" v-model="rejCropFarmlandForm.preshuone"
                                            :style="{ width: '100%' }">
                                            <template slot="append">亩</template>
                                        </el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="12">
                                    <el-form-item label-width="200px" :label="`${preyear}年杂粮补贴面积`" prop="prezaone">
                                        <el-input :disabled="true" v-model="rejCropFarmlandForm.prezaone"
                                            :style="{ width: '100%' }">
                                            <template slot="append">亩</template>
                                        </el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row :gutter="24" style="margin-bottom: 10px; margin-top: 10px;">
                                <el-col :span="12">
                                    <el-form-item label-width="200px" :label="`${preyear}年经济作物种植面积`" prop="prejinjione">
                                        <el-input :disabled="true" v-model="rejCropFarmlandForm.prejinjione"
                                            :style="{ width: '100%' }">
                                            <template slot="append">亩</template>
                                        </el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>

                            <div class="green-line"></div>
                            <el-row :gutter="24" style="margin-bottom: 10px; margin-top: 10px;">
                                <el-col :span="24">
                                    <el-form-item label-width="300px" :label="`${year}年大豆种植补贴面积（第一种轮作）`" prop="curallone">
                                        <el-input :disabled="true" v-model="rejCropFarmlandForm.curallone" type="number"
                                            :style="{ width: '100%' }">
                                            <template slot="append">亩</template>
                                        </el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>

                        </el-card>
                    </div>
                    <div class="card-container" v-if="rejCropFarmlandForm.lunzuoapplytype.includes(2)">
                        <el-card class="infoDiv">
                            <span class="corner-label">第二种轮作</span>

                            <el-row :gutter="24" style="margin-bottom: 10px; margin-top: 10px;">
                                <el-col :span="24">
                                    <el-form-item label-width="400px" :label="`${lastyear}年种植玉米等其他作物、${preyear}年轮作种植大豆面积`"
                                        prop="preyutwo">
                                        <el-input :disabled="true" v-model="rejCropFarmlandForm.preyutwo" type="number"
                                            :style="{ width: '100%' }">
                                            <template slot="append">亩</template>
                                        </el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <div class="green-line"></div>
                            <el-row :gutter="24" style="margin-bottom: 10px; margin-top: 10px;">
                                <el-col :span="24">
                                    <el-form-item label-width="300px" :label="`${year}年大豆种植补贴面积（第二种轮作）`" prop="curalltwo">
                                        <el-input :disabled="true" v-model="rejCropFarmlandForm.curalltwo"
                                            :style="{ width: '100%' }">
                                            <template slot="append">亩</template>
                                        </el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>

                        </el-card>
                    </div>
                    <div class="card-container" v-if="rejCropFarmlandForm.lunzuoapplytype.includes(3)">
                        <el-card class="infoDiv">
                            <span class="corner-label">第三种轮作</span>
                            <el-row :gutter="24" style="margin-bottom: 10px; margin-top: 10px;">
                                <el-col :span="12">
                                    <el-form-item label-width="200px" :label="`${preyear}年大豆种植面积`" prop="predathree">
                                        <el-input :disabled="true" v-model="rejCropFarmlandForm.predathree"
                                            :style="{ width: '100%' }">
                                            <template slot="append">亩</template>
                                        </el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="12">
                                    <el-form-item label-width="200px" :label="`${preyear}年杂豆种植面积`" prop="prezathree">
                                        <el-input :disabled="true" v-model="rejCropFarmlandForm.prezathree"
                                            :style="{ width: '100%' }">
                                            <template slot="append">亩</template>
                                        </el-input>
                                    </el-form-item>
                                </el-col>

                            </el-row>
                            <el-row :gutter="24" style="margin-bottom: 10px; margin-top: 10px;">
                                <el-col :span="12">
                                    <el-form-item label-width="200px" :label="`${preyear}年玉米种植面积`" prop="preyuthree">
                                        <el-input :disabled="true" v-model="rejCropFarmlandForm.preyuthree"
                                            :style="{ width: '100%' }">
                                            <template slot="append">亩</template>
                                        </el-input>
                                    </el-form-item>
                                </el-col> <el-col :span="12" :style="{ width: '100%' }"></el-col>
                            </el-row>
                            <div class="green-line"></div>
                            <el-row :gutter="24" style="margin-bottom: 10px; margin-top: 10px;">
                                <el-col :span="12">
                                    <el-form-item label-width="200px" :label="`${year}年小麦种植面积`" prop="curxiaothree">
                                        <el-input :disabled="true" v-model="rejCropFarmlandForm.curxiaothree"
                                            :style="{ width: '100%' }">
                                            <template slot="append">亩</template>
                                        </el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="12">
                                    <el-form-item label-width="200px" :label="`${year}年马铃薯种植面积`" prop="curmathree">
                                        <el-input :disabled="true" v-model="rejCropFarmlandForm.curmathree"
                                            :style="{ width: '100%' }">
                                            <template slot="append">亩</template>
                                        </el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row :gutter="24" style="margin-bottom: 10px; margin-top: 10px;">
                                <el-col :span="12">
                                    <el-form-item label-width="200px" :label="`${year}年甜菜种植面积`" prop="curtianthree">
                                        <el-input :disabled="true" v-model="rejCropFarmlandForm.curtianthree"
                                            :style="{ width: '100%' }">
                                            <template slot="append">亩</template>
                                        </el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <div class="green-line"></div>
                            <el-row :gutter="24">
                                <el-col :span="24">
                                    <!-- <el-form-item label-width="200px" style="color:gray" label="当甜菜的前茬为马铃薯时：" /> -->
                                    <span style="color:gray;font-weight: bold;">当甜菜的前茬为马铃薯时：</span>
                                </el-col>
                            </el-row>

                            <el-row :gutter="24" style="margin-bottom: 10px; margin-top: 10px;">
                                <el-col :span="12">
                                    <el-form-item label-width="200px" :label="`${preyear}年马铃薯种植补贴面积`" prop="premathreenew">
                                        <el-input :disabled="true" v-model="rejCropFarmlandForm.premathreenew"
                                            :style="{ width: '100%' }">
                                            <template slot="append">亩</template>
                                        </el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="12">
                                    <el-form-item label-width="200px" :label="`${year}年甜菜种植补贴面积`" prop="curtianthreenew">
                                        <el-input :disabled="true" v-model="rejCropFarmlandForm.curtianthreenew"
                                            :style="{ width: '100%' }">
                                            <template slot="append">亩</template>
                                        </el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <div class="green-line"></div>
                            <el-row :gutter="24" style="margin-bottom: 10px; margin-top: 10px;">
                                <el-col :span="24">
                                    <el-form-item label-width="300px" :label="`${year}年合计种植补贴面积（第三种轮作）`" prop="curallthree">
                                        <el-input :disabled="true" v-model="rejCropFarmlandForm.curallthree"
                                            :style="{ width: '100%' }">
                                            <template slot="append">亩</template>
                                        </el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                        </el-card>
                    </div>
                    <div class="card-container" v-if="rejCropFarmlandForm.lunzuoapplytype.includes(4)">
                        <el-card class="infoDiv">
                            <span class="corner-label">第四种轮作</span>
                            <el-row :gutter="24" style="margin-bottom: 10px; margin-top: 10px;">
                                <el-col :span="12">
                                    <el-form-item label-width="200px" :label="`${preyear}年粮食作物补贴面积`" prop="preniangfour">
                                        <el-input :disabled="true" v-model="rejCropFarmlandForm.preniangfour"
                                            :style="{ width: '100%' }">
                                            <template slot="append">亩</template>
                                        </el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="12">
                                    <el-form-item label-width="200px" :label="`${preyear}年经济作物补贴面积`" prop="prejingjifour">
                                        <el-input :disabled="true" v-model="rejCropFarmlandForm.prejingjifour"
                                            :style="{ width: '100%' }">
                                            <template slot="append">亩</template>
                                        </el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <div class="green-line"></div>
                            <el-row :gutter="24" style="margin-bottom: 10px; margin-top: 10px;">
                                <el-col :span="12">
                                    <el-form-item label-width="200px" :label="`${year}年花生种植补贴面积`" prop="curhuafour">
                                        <el-input :disabled="true" v-model="rejCropFarmlandForm.curhuafour"
                                            :style="{ width: '100%' }">
                                            <template slot="append">亩</template>
                                        </el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="12">
                                    <el-form-item label-width="200px" :label="`${year}年葵花籽种植补贴面积`" prop="curkuifour">
                                        <el-input :disabled="true" v-model="rejCropFarmlandForm.curkuifour"
                                            :style="{ width: '100%' }">
                                            <template slot="append">亩</template>
                                        </el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row :gutter="24" style="margin-bottom: 10px; margin-top: 10px;">
                                <el-col :span="12">
                                    <el-form-item label-width="200px" :label="`${year}年白瓜籽种植补贴面积`" prop="curbaifour">
                                        <el-input :disabled="true" v-model="rejCropFarmlandForm.curbaifour"
                                            :style="{ width: '100%' }">
                                            <template slot="append">亩</template>
                                        </el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="12">
                                    <el-form-item label-width="200px" :label="`${year}年油莎豆种植补贴面积`" prop="curyoushafour">
                                        <el-input :disabled="true" v-model="rejCropFarmlandForm.curyoushafour"
                                            :style="{ width: '100%' }">
                                            <template slot="append">亩</template>
                                        </el-input>
                                    </el-form-item>
                                </el-col>

                            </el-row>
                            <el-row :gutter="24" style="margin-bottom: 10px; margin-top: 10px;">
                                <el-col :span="12">
                                    <el-form-item label-width="200px" :label="`${year}年油菜籽籽种植补贴面积`" prop="curyoucaifour">
                                        <el-input :disabled="true" v-model="rejCropFarmlandForm.curyoucaifour"
                                            :style="{ width: '100%' }">
                                            <template slot="append">亩</template>
                                        </el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="12">
                                    <el-form-item label-width="200px" :label="`${year}年芝麻种植补贴面积`" prop="curzhimafour">
                                        <el-input :disabled="true" v-model="rejCropFarmlandForm.curzhimafour"
                                            :style="{ width: '100%' }">
                                            <template slot="append">亩</template>
                                        </el-input>
                                    </el-form-item>
                                </el-col>

                            </el-row>
                            <el-row :gutter="24" style="margin-bottom: 10px; margin-top: 10px;">
                                <el-col :span="12">
                                    <el-form-item label-width="200px" :label="`${year}年胡麻籽种植补贴面积`" prop="curhumafour">
                                        <el-input :disabled="true" v-model="rejCropFarmlandForm.curhumafour"
                                            :style="{ width: '100%' }">
                                            <template slot="append">亩</template>
                                        </el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <div class="green-line"></div>
                            <el-row :gutter="24" style="margin-bottom: 10px; margin-top: 10px;">
                                <el-col :span="24">
                                    <el-form-item label-width="400px" :label="`${year}年合计油料作物种植补贴面积（第四种轮作）`"
                                        prop="curallfour">
                                        <el-input :disabled="true" v-model="rejCropFarmlandForm.curallfour" type="number"
                                            :style="{ width: '100%' }">
                                            <template slot="append">亩</template>
                                        </el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>

                        </el-card>
                    </div>

                    <div class="card-container">
                        <el-card class="infoDiv">
                            <span class="corner-label" style="background-color:rgb(234, 183, 225)">驳回理由</span>
                            <el-row :gutter="24">
                                <el-col :span="24">
                                    <el-form-item>
                                        <el-button @click="approveApply">通过申请</el-button>
                                        <el-button @click="rejectApply">驳回申请</el-button>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row :gutter="12">
                                <el-col :span="24">
                                    <el-form-item label="驳回理由" prop="abnormal" label-width="80px">
                                        <el-input v-model="rejCropFarmlandForm.abnormal" type="textarea"
                                            placeholder="请输入驳回理由" :disabled="isDisabled"
                                            :autosize="{ minRows: 4, maxRows: 8 }" :style="{ width: '100%' }"></el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                        </el-card>
                    </div>
                </el-form>
                <div class="demo-drawer__footer">
                    <el-button @click="cancelCropFarmlandForm">取 消</el-button>
                    <el-button type="primary" @click="submitCropFarmlandForm" :loading="drawerLoading">确定</el-button>
                </div>
            </div>
        </el-drawer>
        <!-- 高蛋白大豆审批抽屉 -->
        <el-drawer :title="title" :visible.sync="prosoyDialog" :with-header="false" direction="rtl" size="60%"
            custom-class="demo-drawer">
            <div class="demo-drawer__content">
                <el-form ref="prosoyRef" :model="rejProsoyForm" size="medium" label-width="260px" label-position="left">
                    <div class="card-container">
                        <el-card class="infoDiv">
                            <span class="corner-label">基本信息</span>
                            <el-row>
                                <el-col :span="24">
                                    <el-form-item label="申报补贴农民(职工、新型经营主体负责人)身份证号码" prop="idCard">
                                        <el-input :disabled="true" v-model="rejProsoyForm.idCard"
                                            :style="{ width: '80%' }"></el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row>
                                <el-col :span="24">
                                    <el-form-item label="申报补贴农民(职工、新型经营主体负责人)姓名" prop="appyBy">
                                        <el-input :disabled="true" v-model="rejProsoyForm.appyBy"
                                            :style="{ width: '80%' }"></el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row>
                                <el-col :span="24">
                                    <el-form-item label="申报补贴农民(职工、新型经营主体负责人)联系电话" prop="phone">
                                        <el-input :disabled="true" v-model="rejProsoyForm.phone"
                                            :style="{ width: '80%' }"></el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row>
                                <el-col :span="24">
                                    <el-form-item label="身份证地址" prop="idCardAddr">
                                        <el-input :disabled="true" v-model="rejProsoyForm.idCardAddr"
                                            :style="{ width: '80%' }"></el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row>
                                <el-col :span="24">
                                    <el-form-item label="现住地址" prop="oftenAddr">
                                        <el-input :disabled="true" v-model="rejProsoyForm.oftenAddr"
                                            :style="{ width: '80%' }"></el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row>
                                <el-col :span="24">
                                    <el-form-item label="申报补贴农民(职工、新型经营主体负责人)一卡通账号" prop="bankCard">
                                        <el-input :disabled="true" v-model="rejProsoyForm.bankCard"
                                            :style="{ width: '80%' }"></el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                        </el-card>
                    </div>
                    <div class="card-container">
                        <el-card class="infoDiv">
                            <span class="corner-label">申报面积</span>
                            <el-row>
                                <el-col :span="24">
                                    <el-form-item label="自有耕地种植大豆面积(亩)" prop="ownArea">
                                        <el-input :disabled="true" v-model="rejProsoyForm.ownArea" type="number"
                                            :style="{ width: '80%' }"></el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <!-- 动态行：使用 v-for 渲染每一条 -->
                            <el-row :gutter="6" v-for="(item, index) in rejProsoyForm.borrow" :key="index"
                                style="margin-bottom: 10px;">
                                <el-col :span="7">
                                    <el-form-item label="承租他人姓名" :prop="'borrow.' + index + '.borrowName'"
                                        label-width="100px">
                                        <el-input :disabled="true" v-model="item.borrowName" placeholder="请输入"
                                            :style="{ width: '100%' }">
                                        </el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="9">
                                    <el-form-item label="承租他人耕地种植大豆面积(亩)" :prop="'borrow.' + index + '.borrowArea'"
                                        label-width="200px">
                                        <el-input :disabled="true" v-model="item.borrowArea" type="number" show-word-limit
                                            :style="{ width: '100%' }">
                                        </el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="8">
                                    <el-form-item label="承租他人联系电话" :prop="'borrow.' + index + '.borrowPhone'"
                                        label-width="130px">
                                        <el-input :disabled="true" v-model="item.borrowPhone" show-word-limit
                                            :style="{ width: '100%' }">
                                        </el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row>
                                <el-col :span="24">
                                    <el-form-item label="承租他人耕地种植大豆面积(亩)" prop="borrowAmount">
                                        <el-input :disabled="true" v-model="rejProsoyForm.borrowAmount" style="width: 80%"
                                            disabled>
                                            <template slot="append">（合计）</template>
                                        </el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row>
                                <el-col :span="24">
                                    <el-form-item :label="`申报补贴农民(职工、新型经营主体)${year}年种植大豆面积(亩)`" prop="gaodanbaiArea">
                                        <el-input :disabled="true" v-model="rejProsoyForm.gaodanbaiArea"
                                            :style="{ width: '80%' }" disabled><template
                                                slot="append">（合计）</template></el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                        </el-card>
                    </div>
                    <div class="card-container">
                        <el-card class="infoDiv">
                            <span class="corner-label">其他情况</span>
                            <el-row>
                                <el-col :span="24">
                                    <el-form-item label-width="420px" :label="`${preyear}年10月1日-${year}年6月30日前购买高蛋白大豆品种名称`"
                                        prop="gaodanbaiType">
                                        <el-input :disabled="true" v-model="rejProsoyForm.gaodanbaiType" type="number"
                                            :style="{ width: '80%' }"></el-input>

                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row>
                                <el-col :span="24">
                                    <el-form-item label-width="420px"
                                        :label="`${preyear}年10月1日-${year}年6月30日前购买高蛋白大豆种子数量(斤)`" prop="gaodanbaiWeight">
                                        <el-input :disabled="true" v-model="rejProsoyForm.gaodanbaiWeight" type="number"
                                            :style="{ width: '80%' }"></el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row>
                                <el-col :span="24">
                                    <el-form-item label-width="420px" :label="`${year}年种植高蛋白大豆面积(亩)(品种粗蛋白含量≥43.0%)`"
                                        prop="areaAmountdouGaodanbai">
                                        <el-input :disabled="true" v-model="rejProsoyForm.areaAmountdouGaodanbai"
                                            type="number" :style="{ width: '80%' }"></el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row>
                                <el-col :span="24">
                                    <el-form-item label-width="420px" label="在何处购买的高蛋白大豆种子(填写具体名称)" prop="gaodanbaiWhere">
                                        <el-input :disabled="true" v-model="rejProsoyForm.gaodanbaiWhere"
                                            :style="{ width: '80%' }"></el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>

                        </el-card>
                    </div>
                    <div class="card-container">
                        <el-card class="infoDiv">
                            <span class="corner-label">附件上传</span>
                            <el-row>
                                <el-col :span="12">
                                    <el-form-item label-width="220px" label="高蛋白大豆补贴申请表" prop="appyExcel">
                                        <el-upload class="upload-demo" :disabled="true"
                                            action="http://111.40.188.220:9060/subsidy/file/upload"
                                            :on-preview="handlePreview"
                                            :on-success="(response, file) => handleSuccess(response, file, 'appyExcel')"
                                            :limit="1" :on-exceed="handleExceed" :file-list="uploadedAppyExcel">
                                            <el-button :disabled="true" icon="el-icon-upload" plain
                                                type="primary">上传附件</el-button>
                                        </el-upload>
                                    </el-form-item>
                                </el-col>
                                <!-- <el-col :span="12">
                                    <span style="color:gray">支持.png.jpg.pdf 等格式，单个附件不得超过512M</span>
                                </el-col> -->
                            </el-row>
                            <el-row>
                                <el-col :span="12">
                                    <el-form-item label-width="220px" label="销售凭证" prop="saleFile">
                                        <el-upload class="upload-demo" :disabled="true"
                                            action="http://111.40.188.220:9060/subsidy/file/upload"
                                            :on-preview="handlePreview"
                                            :on-success="(response, file) => handleSuccess(response, file, 'saleFile')"
                                            :limit="1" :on-exceed="handleExceed" :file-list="uploadedSaleFile">
                                            <el-button :disabled="true" icon="el-icon-upload" plain
                                                type="primary">上传附件</el-button>
                                        </el-upload>
                                    </el-form-item>
                                </el-col>
                                <!-- <el-col :span="12">
                                    <span style="color:gray">支持.png.jpg.pdf 等格式，单个附件不得超过512M</span>
                                </el-col> -->
                            </el-row>
                        </el-card>
                    </div>
                    <div class="card-container">
                        <el-card class="infoDiv">
                            <span class="corner-label">村级负责人信息</span>
                            <el-row>
                                <el-col :span="24">
                                    <el-form-item label-width="200px" label="村级负责人" prop="chargeName">
                                        <el-input :disabled="true" v-model="rejProsoyForm.chargeName"
                                            :style="{ width: '40%' }"></el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row>
                                <el-col :span="24">
                                    <el-form-item label-width="200px" label="负责人职务" prop="chargePost">
                                        <el-input :disabled="true" v-model="rejProsoyForm.chargePost"
                                            :style="{ width: '40%' }"></el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="24">
                                    <el-form-item label-width="200px" label="负责人电话" prop="chargePhone">
                                        <el-input :disabled="true" v-model="rejProsoyForm.chargePhone"
                                            :style="{ width: '40%' }"></el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                        </el-card>
                    </div>
                    <div class="card-container">
                        <el-card class="infoDiv">
                            <span class="corner-label" style="background-color:rgb(234, 183, 225)">驳回理由</span>
                            <el-row :gutter="24">
                                <el-col :span="24">
                                    <el-form-item :disabled="false">
                                        <el-button @click="approveApply">通过申请</el-button>
                                        <el-button @click="rejectApply">驳回申请</el-button>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row :gutter="12">
                                <el-col :span="24">
                                    <el-form-item label="驳回理由" prop="abnormal" label-width="80px" :disabled="false">
                                        <el-input v-model="rejProsoyForm.abnormal" type="textarea" placeholder="请输入驳回理由"
                                            :disabled="isDisabled" :autosize="{ minRows: 4, maxRows: 8 }"
                                            :style="{ width: '100%' }"></el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                        </el-card>
                    </div>
                </el-form>
                <div class="demo-drawer__footer">
                    <el-button @click="cancelProsoyForm">取 消</el-button>
                    <el-button type="primary" @click="submitProsoyForm" :loading="drawerLoading">确定</el-button>
                </div>

            </div>
        </el-drawer>
        <!-- 高油大豆审批抽屉 -->
        <el-drawer :title="title" :visible.sync="oilsoyDialog" :with-header="false" direction="rtl" size="60%"
            custom-class="demo-drawer">
            <div class="demo-drawer__content">
                <el-form ref="oilsoyRef" :model="rejOilsoyForm" size="medium" label-width="260px" label-position="left">
                    <div class="card-container">
                        <el-card class="infoDiv">
                            <span class="corner-label">基本信息</span>
                            <el-row>
                                <el-col :span="24">
                                    <el-form-item label="申报补贴农民(职工、新型经营主体负责人)身份证号码" prop="idCard">
                                        <el-input :disabled="true" v-model="rejOilsoyForm.idCard"
                                            :style="{ width: '80%' }"></el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row>
                                <el-col :span="24">
                                    <el-form-item label="申报补贴农民(职工、新型经营主体负责人)姓名" prop="appyBy">
                                        <el-input :disabled="true" v-model="rejOilsoyForm.appyBy"
                                            :style="{ width: '80%' }"></el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row>
                                <el-col :span="24">
                                    <el-form-item label="申报补贴农民(职工、新型经营主体负责人)联系电话" prop="phone">
                                        <el-input :disabled="true" v-model="rejOilsoyForm.phone"
                                            :style="{ width: '80%' }"></el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row>
                                <el-col :span="24">
                                    <el-form-item label="身份证地址" prop="idCardAddr">
                                        <el-input :disabled="true" v-model="rejOilsoyForm.idCardAddr"
                                            :style="{ width: '80%' }"></el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row>
                                <el-col :span="24">
                                    <el-form-item label="现住地址" prop="oftenAddr">
                                        <el-input :disabled="true" v-model="rejOilsoyForm.oftenAddr"
                                            :style="{ width: '80%' }"></el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row>
                                <el-col :span="24">
                                    <el-form-item label="申报补贴农民(职工、新型经营主体负责人)一卡通账号" prop="bankCard">
                                        <el-input :disabled="true" v-model="rejOilsoyForm.bankCard"
                                            :style="{ width: '80%' }"></el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                        </el-card>
                    </div>
                    <div class="card-container">
                        <el-card class="infoDiv">
                            <span class="corner-label">申报面积</span>
                            <el-row>
                                <el-col :span="24">
                                    <el-form-item label="自有耕地种植大豆面积(亩)" prop="ownArea">
                                        <el-input :disabled="true" v-model="rejOilsoyForm.ownArea" type="number"
                                            :style="{ width: '80%' }"></el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <!-- 动态行：使用 v-for 渲染每一条 -->
                            <el-row :gutter="16" v-for="(item, index) in rejOilsoyForm.borrow" :key="index"
                                style="margin-bottom: 10px;">
                                <el-col :span="6">
                                    <el-form-item label="承租他人姓名" :prop="'borrow.' + index + '.borrowName'"
                                        label-width="100px">
                                        <el-input v-model="item.borrowName" placeholder="请输入" :style="{ width: '100%' }">
                                        </el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="9">
                                    <el-form-item label="承租他人耕地种植大豆面积(亩)" :prop="'borrow.' + index + '.borrowArea'"
                                        label-width="220px">
                                        <el-input v-model="item.borrowArea" type="number" show-word-limit
                                            :style="{ width: '100%' }">
                                        </el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="7">
                                    <el-form-item label="承租他人联系电话" :prop="'borrow.' + index + '.borrowPhone'"
                                        label-width="130px">
                                        <el-input v-model="item.borrowPhone" show-word-limit :style="{ width: '100%' }">
                                        </el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row>
                                <el-col :span="24">
                                    <el-form-item label="承租他人耕地种植大豆面积(亩)" prop="borrowAmount">
                                        <el-input :disabled="true" v-model="rejOilsoyForm.borrowAmount" style="width: 80%"
                                            disabled>
                                            <template slot="append">（合计）</template>
                                        </el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row>
                                <el-col :span="24">
                                    <el-form-item :label="`申报补贴农民(职工、新型经营主体)${year}年种植大豆面积(亩)`" prop="gaodanbaiArea">
                                        <el-input :disabled="true" v-model="rejOilsoyForm.gaodanbaiArea"
                                            :style="{ width: '80%' }" disabled><template
                                                slot="append">（合计）</template></el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                        </el-card>
                    </div>
                    <div class="card-container">
                        <el-card class="infoDiv">
                            <span class="corner-label">其他情况</span>
                            <el-row>
                                <el-col :span="24">
                                    <el-form-item label-width="420px" :label="`${preyear}年10月1日-${year}年6月30日前购买高蛋白大豆品种名称`"
                                        prop="gaodanbaiType">
                                        <el-input :disabled="true" v-model="rejOilsoyForm.gaodanbaiType" type="number"
                                            :style="{ width: '80%' }"></el-input>

                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row>
                                <el-col :span="24">
                                    <el-form-item label-width="420px"
                                        :label="`${preyear}年10月1日-${year}年6月30日前购买高蛋白大豆种子数量(斤)`" prop="gaodanbaiWeight">
                                        <el-input :disabled="true" v-model="rejOilsoyForm.gaodanbaiWeight" type="number"
                                            :style="{ width: '80%' }"></el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row>
                                <el-col :span="24">
                                    <el-form-item label-width="420px" :label="`${year}年种植高蛋白大豆面积(亩)(品种粗蛋白含量≥23.5%)`"
                                        prop="areaAmountdouGaoyou">
                                        <el-input :disabled="true" v-model="rejOilsoyForm.areaAmountdouGaoyou" type="number"
                                            :style="{ width: '80%' }"></el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row>
                                <el-col :span="24">
                                    <el-form-item label-width="420px" label="在何处购买的高蛋白大豆种子(填写具体名称)" prop="gaodanbaiWhere">
                                        <el-input :disabled="true" v-model="rejOilsoyForm.gaodanbaiWhere"
                                            :style="{ width: '80%' }"></el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>

                        </el-card>
                    </div>
                    <div class="card-container">
                        <el-card class="infoDiv">
                            <span class="corner-label">附件上传</span>
                            <el-row>
                                <el-col :span="12">
                                    <el-form-item label-width="220px" label="高蛋白大豆补贴申请表" prop="appyExcel">
                                        <el-upload class="upload-demo" :disabled="true"
                                            action="http://111.40.188.220:9060/subsidy/file/upload"
                                            :on-preview="handlePreview"
                                            :on-success="(response, file) => handleSuccess(response, file, 'appyExcel')"
                                            :limit="1" :on-exceed="handleExceed" :file-list="uploadedAppyExcel">
                                            <el-button :disabled="true" icon="el-icon-upload" plain
                                                type="primary">上传附件</el-button>
                                        </el-upload>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="12">
                                    <span style="color:gray">支持.png.jpg.pdf 等格式，单个附件不得超过512M</span>
                                </el-col>
                            </el-row>
                            <el-row>
                                <el-col :span="12">
                                    <el-form-item label-width="220px" label="销售凭证" prop="saleFile">
                                        <el-upload class="upload-demo"
                                            action="http://111.40.188.220:9060/subsidy/file/upload"
                                            :on-preview="handlePreview" :disabled="true"
                                            :on-success="(response, file) => handleSuccess(response, file, 'saleFile')"
                                            :limit="1" :on-exceed="handleExceed" :file-list="uploadedSaleFile">
                                            <el-button :disabled="true" icon="el-icon-upload" plain
                                                type="primary">上传附件</el-button>
                                        </el-upload>
                                    </el-form-item>
                                </el-col>
                                <!-- <el-col :span="12">
                                    <span style="color:gray">支持.png.jpg.pdf 等格式，单个附件不得超过512M</span>
                                </el-col> -->
                            </el-row>
                        </el-card>
                    </div>
                    <div class="card-container">
                        <el-card class="infoDiv">
                            <span class="corner-label">村级负责人信息</span>
                            <el-row>
                                <el-col :span="24">
                                    <el-form-item label-width="200px" label="村级负责人" prop="chargeName">
                                        <el-input :disabled="true" v-model="rejOilsoyForm.chargeName"
                                            :style="{ width: '40%' }"></el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row>
                                <el-col :span="24">
                                    <el-form-item label-width="200px" label="负责人职务" prop="chargePost">
                                        <el-input :disabled="true" v-model="rejOilsoyForm.chargePost"
                                            :style="{ width: '40%' }"></el-input>
                                    </el-form-item>
                                </el-col>
                                <el-col :span="24">
                                    <el-form-item label-width="200px" label="负责人电话" prop="chargePhone">
                                        <el-input :disabled="true" v-model="rejOilsoyForm.chargePhone"
                                            :style="{ width: '40%' }"></el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                        </el-card>
                    </div>
                    <div class="card-container">
                        <el-card class="infoDiv">
                            <span class="corner-label" style="background-color:rgb(234, 183, 225)">驳回理由</span>
                            <el-row :gutter="24">
                                <el-col :span="24">
                                    <el-form-item>
                                        <el-button @click="approveApply">通过申请</el-button>
                                        <el-button @click="rejectApply">驳回申请</el-button>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                            <el-row :gutter="12">
                                <el-col :span="24">
                                    <el-form-item label="驳回理由" prop="abnormal" label-width="80px">
                                        <el-input v-model="rejOilsoyForm.abnormal" type="textarea" placeholder="请输入驳回理由"
                                            :disabled="isDisabled" :autosize="{ minRows: 4, maxRows: 8 }"
                                            :style="{ width: '100%' }"></el-input>
                                    </el-form-item>
                                </el-col>
                            </el-row>
                        </el-card>
                    </div>
                </el-form>
                <div class="demo-drawer__footer">
                    <el-button @click="cancelOilsoyForm">取 消</el-button>
                    <el-button type="primary" @click="submitOilsoyForm" :loading="drawerLoading">确定</el-button>
                </div>

            </div>
        </el-drawer>

    </div>
</template>
    
<script>
import { queryTownRes, listProduce, getProduceById, delSubsidyApplication,getProduceByappNum, submitProduce, rejectAllProduce, rejectProduce, approveProduce, approveBatchProduce } from "@/api/agriculture/agriculture";
import { listStrativeArea, getStrativeArea, delStrativeArea, addStrativeArea, updateStrativeArea } from "@/api/subsidy/strativeArea";
import * as XLSX from 'xlsx';

export default {
    data() {
        const now = new Date();
        return {
            isAdmin: false,
            // 选中数组
            ids: [],
            // 非单个禁用
            single: true,
            // 非多个禁用
            multiple: true,

            uploadedFiles: [],

            year: now.getFullYear(), //今年
            preyear: now.getFullYear() - 1,//去年
            lastyear: now.getFullYear() - 2, //前年
            // 按钮loading
            buttonLoading: false,
            // 表格
            tableLoading: true,
            produceLoading: true,
            oilsoyLoading: false,
            prosoyLoading: false,

            // 显示搜索条件
            showSearch: true,
            produceDialog: false, //抽屉的显示与隐藏
            farmlandDialog: false,
            cropfarmlandDialog: false,
            prosoyDialog: false,
            oilsoyDialog: false,
            drawerLoading: false, //抽屉的提交
            isDisabled: true,  // 控制驳回理由是否禁用输入
            selectStatus: '全部',
            list: [],

            rejProduceForm: {}, //审批生产者表格
            rejFarmlandForm: {}, //审批生产者表格
            rejCropFarmlandForm: {
                lunzuoapplytype: [],
            }, //审批耕地轮作表格
            rejOilsoyForm: {}, //审批高油大豆表格
            rejProsoyForm: {}, //审批高蛋白大豆表格

            //区级一键驳回弹窗
            disRejTitle: '',
            disRejDialog: false,
            disRejform: {
                abnormal: undefined,
            },  //区级驳回乡级理由填写

            rejectText: '', //区级对乡级的驳回理由
            rejectButton: false,
            title: '',
            open: false,
            pendingNum: 0,
            // 是否展开，默认全部展开
            isExpandAll: true,
            // 重新渲染表格状态
            refreshTable: true,
            townOptions: [],
            villageOptions: [],

            userName: '',
            role: '',  //当前登录角色
            uploadedAppyExcel: [], //申请表url存储
            uploadedSaleFile: [], //销售url存储
            rotationTypeOptions: [ //轮作方式存储
                { "value": 1, "label": '第一种：去年种植玉米/小麦/杂粮/薯类/经济作物，今年种植大豆' },
                { "value": 2, "label": '第二种：前年种植玉米，去年种植大豆，今年种植大豆' },
                { "value": 3, "label": '第三种：去年种植大豆/杂豆/玉米，2025年种小麦/马铃薯/甜菜（其中甜菜前茬可以为马铃薯）' },
                { "value": 4, "label": '第四种：去年种植粮食作物/经济作物，今年种植油料作物（限指定市县）' }
            ],

            //统计数据
            sumData: {},

            total: 0, // 总条数
            quanbutotal: 0,
            yichangtotal: 0,  //异常总条数
            daichutotal: 0,   //待处理条数
            yichulitotal: 0,  //已处理条数
            shenhetotal: 0,   //审核中条数

            subsidyOptions: [{
                "label": "生产者补贴",
                "value": "生产者补贴"
            }, {
                "label": "高油大豆补贴",
                "value": "高油大豆补贴"
            }, {
                "label": "高蛋白大豆补贴",
                "value": "高蛋白大豆补贴"
            }, {
                "label": "耕地地力补贴",
                "value": "耕地地力补贴"
            }, {
                "label": "耕地轮作补贴",
                "value": "耕地轮作补贴"
            }],
            queryParams: {
                pageNum: 1,
                pageSize: 10,
                appType: '生产者补贴',
                // subsidy: '高油大豆',
                straName: '滴道区',
                idCard: undefined,
                bankCard: undefined,
                villageName: undefined,
                townName: undefined,
                year: now.getFullYear(),
                isprice: 1,
            },
            // subsidyApplicationList: [],
        }
    },
    computed: {
        //补贴数据展示
        showProducerColumns() {
            return this.queryParams.appType === '生产者补贴';
        },
        showHighProteinColumns() {
            return this.queryParams.appType === '高蛋白大豆补贴';
        },
        showHighOilColumns() {
            return this.queryParams.appType === '高油大豆补贴';
        },
        showFarmLandColumns() {
            return this.queryParams.appType === '耕地地力补贴';
        },
        showCropFarmLandColumns() {
            return this.queryParams.appType === '耕地轮作补贴';
        }
    },
    created() {
        // console.log("目前登录的角色是3332", this.$store.state.user.user.roles[0].roleKey)
        console.log("目前登录的角色是1111", this.$store.state.user.roles[0])

        console.log("目前登录用户", this.$store.state.user.user, this.$store.state.user.roles[0])
        if (this.$store.state.user.user.villageName) {
            this.queryParams.villageName = this.$store.state.user.user.villageName;
        }

        // this.userName = this.$store.state.user.name;
        this.role = this.$store.state.user.roles[0];
        // if (this.role == 'village') {
        //     this.queryParams.villageName = this.userName;
        if (this.role == 'admin') {
            this.isAdmin = true;
        }

        if (this.role == 'town') {
            console.log("乡登录", this.role)
            this.townName = this.$store.state.user.user.townName;
            this.queryParams.townName = this.townName;
            listStrativeArea({ townName: this.townName }).then(response => {
                console.log("村列表数据展示", response[0].children[0].children)
                this.villageOptions = response[0].children[0].children;
            })
            queryTownRes({ year: this.year, type: this.queryParams.appType, name: this.queryParams.townName, isprice: '1' }).then(res => {
                console.log("区级驳回理由", res)
                if (res.rows.length > 0 && res.rows[res.rows.length - 1].reject) {
                    console.log("res", res.rows[res.rows.length - 1].reject)
                    this.rejectText = res.rows[res.rows.length - 1].reject
                    if (this.rejectText) {
                        this.rejectButton = true;
                    } else {
                        this.rejectButton = false;
                    }
                }
            });
        }
        listStrativeArea({ departmentName: '滴道区' }).then(response => {
            console.log("乡列表数据展示", response[0].children)
            this.townOptions = response[0].children;
        })
        this.getList();
    },
    methods: {
        //导出高油补贴表单
        handleExportYou(row) {
            getProduceById(row.id).then(response => {
                const data = response.data;
                // 判断 borrow 是否为字符串，如果是，尝试解析为数组
                if (data.borrow && typeof data.borrow === 'string') {
                    try {
                        data.borrow = JSON.parse(data.borrow);
                    } catch (error) {
                        console.warn('解析 borrow 字段失败，使用空数组', error);
                        data.borrow = []; // 解析失败时给默认值
                    }
                } else if (!data.borrow) {
                    // 如果 borrow 为 null/undefined，初始化为空数组
                    data.borrow = [];
                }
                let gaoYouForm = data;
                console.log("高油蛋白的表数据", gaoYouForm.areaAmountdouGaodanbai)

                const filePath = '/excel/personGaoyou.xlsx'; // public 目录下的 Excel 文件路径
                // 使用 fetch 从 public 目录加载文件
                fetch(filePath)
                    .then(response => response.arrayBuffer()) // 获取文件内容的 ArrayBuffer
                    .then(data => {
                        const wb = XLSX.read(data, { type: 'buffer' });
                        // 获取第一个工作表
                        const ws = wb.Sheets[wb.SheetNames[0]];

                        // 获取工作表的所有数据（不丢失原始样式）
                        const wsData = XLSX.utils.sheet_to_json(ws, { header: 1 });

                        // 获取合并单元格的区域
                        const merges = ws['!merges'] || [];

                        // 获取行高和列宽
                        const rowHeights = ws['!rows'] || [];
                        const colWidths = ws['!cols'] || [];

                        // 将新数据添加到工作表数据中
                        gaoYouForm.borrow.forEach((item, index) => {
                            if (index < 7) {
                                if (index === 0) {
                                    wsData[5 + index] = [
                                        gaoYouForm.appyBy,
                                        gaoYouForm.gaodanbaiArea,
                                        gaoYouForm.ownArea,
                                        gaoYouForm.borrowAmount,
                                        item.borrowName,
                                        item.borrowArea,
                                        item.borrowPhone,
                                        gaoYouForm.gaodanbaiType,
                                        gaoYouForm.gaodanbaiWeight,
                                        gaoYouForm.areaAmountdouGaoyou,
                                        gaoYouForm.gaodanbaiWhere,
                                        gaoYouForm.phone,
                                        gaoYouForm.idCard
                                    ];
                                } else {
                                    wsData[5 + index] = ['', '', '', '', '', item.borrowName, item.borrowArea, item.borrowPhone, '', '', '', '', '', ''];
                                }
                            } else {
                                wsData.splice(5 + index, 0, ['', '', '', '', '', item.borrowName, item.borrowArea, item.borrowPhone, '', '', '', '', '', '']);
                            }
                        });
                        console.log("最终的数据", wsData);
                        // 将修改后的数据重新写回工作表
                        const newWs = XLSX.utils.aoa_to_sheet(wsData);

                        // 保留合并单元格区域
                        newWs['!merges'] = merges;

                        for (const cell in ws) {
                            if (cell[0] === '!' || !newWs[cell]) continue; // 跳过非单元格或 newWs 中不存在的
                            if (ws[cell] && ws[cell].s) {
                                if (!newWs[cell].s) newWs[cell].s = {};
                                Object.assign(newWs[cell].s, ws[cell].s); // 合并样式
                            }
                            // 可选：保留字体、对齐等
                        }

                        // 保留行高和列宽
                        newWs['!rows'] = rowHeights;
                        newWs['!cols'] = colWidths;

                        // ✅ 关键：必须把新工作表写回工作簿
                        wb.Sheets[wb.SheetNames[0]] = newWs;

                        // 导出修改后的文件
                        const filename = '高油大豆申请表.xlsx'; // 使用 .xlsx 格式
                        XLSX.writeFile(wb, filename);

                        this.message = `文件已导出: ${filename}`;
                    })
                    .catch(error => {
                        console.error('文件加载失败:', error);
                        this.message = '加载 Excel 文件失败';
                    });
            })

        },
        handleExportDan(row) {
            getProduceById(row.id).then(response => {
                const data = response.data;
                // 判断 borrow 是否为字符串，如果是，尝试解析为数组
                if (data.borrow && typeof data.borrow === 'string') {
                    try {
                        data.borrow = JSON.parse(data.borrow);
                    } catch (error) {
                        console.warn('解析 borrow 字段失败，使用空数组', error);
                        data.borrow = []; // 解析失败时给默认值
                    }
                } else if (!data.borrow) {
                    // 如果 borrow 为 null/undefined，初始化为空数组
                    data.borrow = [];
                }
                let gaoDanForm = data;
                console.log("高蛋白表2", gaoDanForm)

                const filePath = '/excel/personGaodanbai.xlsx'; // public 目录下的 Excel 文件路径
                // 使用 fetch 从 public 目录加载文件
                fetch(filePath)
                    .then(response => response.arrayBuffer()) // 获取文件内容的 ArrayBuffer
                    .then(data => {
                        const wb = XLSX.read(data, { type: 'buffer' });

                        // 获取第一个工作表
                        const ws = wb.Sheets[wb.SheetNames[0]];

                        // 获取工作表的所有数据（不丢失原始样式）
                        const wsData = XLSX.utils.sheet_to_json(ws, { header: 1 });

                        // 获取合并单元格的区域
                        const merges = ws['!merges'] || [];

                        // 获取行高和列宽
                        const rowHeights = ws['!rows'] || [];
                        const colWidths = ws['!cols'] || [];

                        // 将新数据添加到工作表数据中
                        gaoDanForm.borrow.forEach((item, index) => {
                            if (index < 7) {
                                if (index === 0) {
                                    wsData[5 + index] = [
                                        gaoDanForm.appyBy,
                                        gaoDanForm.gaodanbaiArea,
                                        gaoDanForm.ownArea,
                                        gaoDanForm.borrowAmount,
                                        item.borrowName,
                                        item.borrowArea,
                                        item.borrowPhone,
                                        gaoDanForm.gaodanbaiType,
                                        gaoDanForm.gaodanbaiWeight,
                                        gaoDanForm.areaAmountdouGaodanbai,
                                        gaoDanForm.gaodanbaiWhere,
                                        gaoDanForm.phone,
                                        gaoDanForm.idCard
                                    ];
                                } else {
                                    wsData[5 + index] = ['', '', '', '', '', item.borrowName, item.borrowArea, item.borrowPhone, '', '', '', '', '', ''];
                                }
                            } else {
                                wsData.splice(5 + index, 0, ['', '', '', '', '', item.borrowName, item.borrowArea, item.borrowPhone, '', '', '', '', '', '']);
                            }
                        });
                        console.log("最终的数据", wsData);
                        // 将修改后的数据重新写回工作表
                        const newWs = XLSX.utils.aoa_to_sheet(wsData);

                        // 保留合并单元格区域
                        newWs['!merges'] = merges;

                        for (const cell in ws) {
                            if (cell[0] === '!' || !newWs[cell]) continue; // 跳过非单元格或 newWs 中不存在的
                            if (ws[cell] && ws[cell].s) {
                                if (!newWs[cell].s) newWs[cell].s = {};
                                Object.assign(newWs[cell].s, ws[cell].s); // 合并样式
                            }
                            // 可选：保留字体、对齐等
                        }

                        // 保留行高和列宽
                        newWs['!rows'] = rowHeights;
                        newWs['!cols'] = colWidths;

                        // ✅ 关键：必须把新工作表写回工作簿
                        wb.Sheets[wb.SheetNames[0]] = newWs;


                        // 导出修改后的文件
                        const filename = '高蛋白大豆申请表.xlsx'; // 使用 .xlsx 格式
                        XLSX.writeFile(wb, filename);

                        this.message = `文件已导出: ${filename}`;
                    })
                    .catch(error => {
                        console.error('文件加载失败:', error);
                        this.message = '加载 Excel 文件失败';
                    });
            })
            // console.log("高蛋白表", row)
            // if (row.borrow && typeof row.borrow === 'string') {
            //     try {
            //         row.borrow = JSON.parse(row.borrow);
            //     } catch (error) {
            //         console.warn('解析 borrow 字段失败，使用空数组', error);
            //         row.borrow = []; // 解析失败时给默认值
            //     }
            // } else if (!row.borrow) {
            //     // 如果 borrow 为 null/undefined，初始化为空数组
            //     row.borrow = [];
            // }
            // let gaoDanForm = row;

        },
        //审核生产者补贴
        submitProduceForm: function () {
            //判断点击的审批通过还是驳回按钮
            this.$refs['produceRef'].validate(valid => {
                if (valid) {
                    if (this.isDisabled) {//驳回禁用 ，审核通过
                        // console.log('已查看')
                        approveProduce({ appNum: this.rejProduceForm.appNum }).then(response => {
                            this.$modal.msgSuccess("已审核");
                            this.produceDialog = false;
                            this.getList();
                        })
                    } else {   //驳回
                        rejectProduce({ appNum: this.rejProduceForm.appNum, abnormal: this.rejProduceForm.abnormal }).then(response => {
                            this.$modal.msgSuccess("驳回成功");
                            this.produceDialog = false;
                            this.getList();

                        })
                    }
                }
            })
        },
        //审核耕地地力补贴
        submitFarmlandForm: function () {
            //判断点击的审批通过还是驳回按钮
            this.$refs['farmlandRef'].validate(valid => {
                if (valid) {
                    if (this.isDisabled) {//驳回禁用 ，审核通过
                        // console.log('已查看')
                        approveProduce({ appNum: this.rejFarmlandForm.appNum }).then(response => {
                            this.$modal.msgSuccess("已审核");
                            this.farmlandDialog = false;
                            this.getList();
                        })
                    } else {   //驳回
                        rejectProduce({ appNum: this.rejFarmlandForm.appNum, abnormal: this.rejFarmlandForm.abnormal }).then(response => {
                            this.$modal.msgSuccess("驳回成功");
                            this.farmlandDialog = false;
                            this.getList();

                        })
                    }
                }
            })
        },
        //审核耕地轮作补贴
        submitCropFarmlandForm: function () {
            //判断点击的审批通过还是驳回按钮
            this.$refs['cropfarmlandRef'].validate(valid => {
                if (valid) {
                    if (this.isDisabled) {//驳回禁用 ，审核通过
                        // console.log('已查看')
                        approveProduce({ appNum: this.rejCropFarmlandForm.appNum }).then(response => {
                            this.$modal.msgSuccess("已审核");
                            this.cropfarmlandDialog = false;
                            this.getList();
                        })
                    } else {   //驳回
                        rejectProduce({ appNum: this.rejCropFarmlandForm.appNum, abnormal: this.rejCropFarmlandForm.abnormal }).then(response => {
                            this.$modal.msgSuccess("驳回成功");
                            this.cropfarmlandDialog = false;
                            this.getList();

                        })
                    }
                }
            })
        },
        //审核高蛋白大豆补贴
        submitProsoyForm: function () {
            //判断点击的审批通过还是驳回按钮
            this.$refs['prosoyRef'].validate(valid => {
                if (valid) {
                    if (this.isDisabled) {//驳回禁用 ，审核通过
                        // console.log('已查看')
                        approveProduce({ appNum: this.rejProsoyForm.appNum }).then(response => {
                            this.$modal.msgSuccess("已审核");
                            this.prosoyDialog = false;
                            this.getList();
                        })
                    } else {   //驳回
                        rejectProduce({ appNum: this.rejProsoyForm.appNum, abnormal: this.rejProsoyForm.abnormal }).then(response => {
                            this.$modal.msgSuccess("驳回成功");
                            this.prosoyDialog = false;
                            this.getList();
                        })
                    }
                }
            })
        },
        //审核高油大豆补贴
        submitOilsoyForm: function () {
            //判断点击的审批通过还是驳回按钮
            this.$refs['oilsoyRef'].validate(valid => {
                if (valid) {
                    if (this.isDisabled) {//驳回禁用 ，审核通过
                        // console.log('已查看')
                        approveProduce({ appNum: this.rejOilsoyForm.appNum }).then(response => {
                            this.$modal.msgSuccess("已审核");
                            this.oilsoyDialog = false;
                            this.getList();
                        })
                    } else {   //驳回
                        rejectProduce({ appNum: this.rejOilsoyForm.appNum, abnormal: this.rejOilsoyForm.abnormal }).then(response => {
                            this.$modal.msgSuccess("驳回成功");
                            this.oilsoyDialog = false;
                            this.getList();
                        })
                    }
                }
            })
        },

        //查看区级给乡级的驳回理由
        viewReject() {
            this.$alert(this.rejectText, '驳回理由', {
                confirmButtonText: '确定',
                callback: action => {
                    this.$message({
                        type: 'info',
                        message:'确认驳回理由'
                    });
                }
            })
        },

        // 村级一键提交待处理
        submitPending() {
            this.$confirm(`此操作将提交${this.queryParams.appType}到下一流程节点`, '提交提示', {
                confirmButtonText: '确定',
                cancelButtonText: '取消',
                type: 'warning'
            }).then(() => {
                submitProduce({ year: this.year, appType: this.queryParams.appType, isprice: "1" }).then(response => {
                    this.$modal.msgSuccess("提交成功");
                    this.getList();
                })
            }).catch(error => {
                this.$message({ type: 'info', message: '取消提交!' });
            });
        },
        //乡级一键驳回
        townRejectAll() {
            if (this.queryParams.villageName) {
                this.$confirm(`此操作将对: ${this.queryParams.villageName}提交的${this.queryParams.appType}进行驳回`, '驳回提示', {
                    confirmButtonText: '确定',
                    cancelButtonText: '取消',
                    type: 'warning'
                }).then(() => {
                    rejectAllProduce({
                        year: this.year,
                        appType: this.queryParams.appType,
                        villageName: this.queryParams.villageName,
                        node: "1",
                        nodeName: this.queryParams.villageName,
                        isprice: "1",
                    }).then(res => {
                        // this.$message({
                        //     type: 'success',
                        //     message: '驳回成功!'
                        // });
                        this.$modal.msgSuccess("一键驳回成功");
                        this.getList();
                    });

                }).catch(() => {
                    this.$message({
                        type: 'info',
                        message: '已取消驳回'
                    });
                });
            } else {
                this.$message({ type: 'error', message: '请选择需要驳回的村!' });
            }
        },
        //乡级处理多个
        townApproveAll() {
            const output = this.ids.map(item => ({
                appNum: item
            }));
            // console.log("选择的ids", output);
            approveBatchProduce(output).then(res => {
                this.$modal.msgSuccess("选择的数据已审核");
                this.multiple = false;
                this.ids = [];
                this.getList();
            })
        },
        // 多选框选中数据
        handleSelectionChange(selection) {
            this.ids = selection.map(item => item.appNum);
            console.log("多选的ids", this.ids)
            this.single = selection.length != 1
            this.multiple = !selection.length //数量为0，为true，不为0时为false
            console.log("多选的ids", this.single, this.multiple)

        },
        //打开区级一键驳回对话框，并提交
        submitDisRej() {
            rejectAllProduce({
                year: this.year,
                appType: this.queryParams.appType,
                townName: this.queryParams.townName,
                node: "2",
                nodeName: this.queryParams.townName,
                isprice: "1",
                abnormal: this.disRejform.abnormal
            }).then(res => {
                this.$modal.msgSuccess("一键驳回成功");
                this.getList();
            })
        },

        //区级一键驳回按钮
        disRejectAll() {
            if (this.queryParams.townName) {
                this.disRejTitle = this.queryParams.appType + "驳回到" + this.queryParams.townName;
                this.disRejDialog = true;
            } else {
                this.disRejDialog = false;
                this.$message({ type: 'error', message: '请选择需要驳回的乡!' });
            }
        },

        approveApply() {
            this.isDisabled = true; // 切换禁用状态 
        },
        rejectApply() {
            this.isDisabled = false; // 切换禁用状态
        },

        handleRejectProduce(row) {
            getProduceById(row.id).then(response => {
                this.rejProduceForm = response.data;
                this.produceDialog = true;
                this.title = "生产者补贴审核";
            });
        },
        //耕地地力审核抽屉打开
        handleRejectFarmland(row) {
            console.log("打开耕地地力抽屉");
            getProduceById(row.id).then(response => {
                this.rejFarmlandForm = response.data;
                this.farmlandDialog = true;
                this.title = "耕地地力补贴审核";
            });
        },
        //耕地轮作审核抽屉打开
        handleRejectCropFarmland(row) {
            console.log("打开耕地轮作抽屉");
            getProduceById(row.id).then(response => {
                // const data = response.data || {};
                // console.log("耕地列表", data.lunzuoapplytype);
                // this.rejCropFarmlandForm = Object.assign({}, data, {
                //     lunzuoapplytype: (() => {
                //         const val = data.lunzuoapplytype;
                //         if (Array.isArray(val)) return val;
                //         if (val === null || val === undefined) return [];
                //         if (typeof val === 'string') return val.split(','); // 如果是逗号分隔字符串，如 "1,2"
                //         return [];
                //     })()
                // });
                this.rejCropFarmlandForm = response.data;
                this.cropfarmlandDialog = true;
                this.title = "耕地轮作补贴审核";
            });
        },
        //高油审批
        handleRejectOilsoy(row) {
            getProduceById(row.id).then(response => {
                const data = response.data;
                // 判断 borrow 是否为字符串，如果是，尝试解析为数组
                if (data.borrow && typeof data.borrow === 'string') {
                    try {
                        data.borrow = JSON.parse(data.borrow);
                    } catch (error) {
                        console.warn('解析 borrow 字段失败，使用空数组', error);
                        data.borrow = []; // 解析失败时给默认值
                    }
                } else if (!data.borrow) {
                    // 如果 borrow 为 null/undefined，初始化为空数组
                    data.borrow = [];
                }
                this.title = "补贴申报驳回";
                this.oilsoyDialog = true;
                this.rejOilsoyForm = data;
                this.uploadedAppyExcel = [];
                this.uploadedSaleFile = [];
                this.uploadedAppyExcel.push({ name: '申请表', url: this.rejOilsoyForm.appyExcel })
                this.uploadedSaleFile.push({ name: '销售凭证', url: this.rejOilsoyForm.saleFile });

            });
        },

        //高蛋白审批
        handleRejectProsoy(row) {
            // this.reset();
            getProduceById(row.id).then(response => {
                const data = response.data;
                console.log("审批高蛋白", data.borrow)
                // 判断 borrow 是否为字符串，如果是，尝试解析为数组
                if (data.borrow && typeof data.borrow === 'string') {
                    try {
                        data.borrow = JSON.parse(data.borrow);
                    } catch (error) {
                        console.warn('解析 borrow 字段失败，使用空数组', error);
                        data.borrow = []; // 解析失败时给默认值
                    }
                } else if (!data.borrow) {
                    // 如果 borrow 为 null/undefined，初始化为空数组
                    data.borrow = [];
                }

                console.log("审批高蛋白2", data.borrow)
                this.prosoyDialog = true;
                this.rejProsoyForm = data;
                this.uploadedAppyExcel = [];
                this.uploadedSaleFile = [];
                this.uploadedAppyExcel.push({ name: '申请表', url: this.rejProsoyForm.appyExcel })
                this.uploadedSaleFile.push({ name: '销售凭证', url: this.rejProsoyForm.saleFile });

                console.log("审批蛋白表", this.rejProsoyForm);

                this.title = "补贴申报驳回";
            });
        },
        //取消抽屉
        cancelProduceForm() {
            this.drawerLoading = false;
            this.produceDialog = false;
            this.isDisabled = true; // 驳回理由禁用状态
        },
        cancelFarmlandForm() {
            this.drawerLoading = false;
            this.farmlandDialog = false;
            this.isDisabled = true; // 驳回理由禁用状态
        },
        cancelCropFarmlandForm() {
            this.drawerLoading = false;
            this.cropfarmlandDialog = false;
            this.isDisabled = true; // 驳回理由禁用状态
        },
        cancelProsoyForm() {
            this.drawerLoading = false;
            this.prosoyDialog = false;
            this.isDisabled = true; // 驳回理由禁用状态
        },
        cancelOilsoyForm() {
            this.drawerLoading = false;
            this.oilsoyDialog = false;
            this.isDisabled = true; // 驳回理由禁用状态
        },
        //查看乡级核查函
        viewTownCheck() {
            if (this.queryParams.townName) {
                console.log("查看核查函类型", this.queryParams.appType)
                let queryData = { year: this.year, type: this.queryParams.appType, name: this.queryParams.townName, isprice: '1' }
                // console.log("乡级核查函查询条件", queryData)
                queryTownRes(queryData).then(res => {
                    //  console.log("乡级核查函res", res)
                    if (res.rows.length > 0 && res.rows[res.rows.length - 1].hechafile) {
                        console.log("res", res.rows[res.rows.length - 1].hechafile)
                        const pdfUrl = res.rows[res.rows.length - 1].hechafile.replace('172.24.254.135', '111.40.188.220');
                        const routeData = this.$router.resolve({
                            name: 'PdfViewer',
                            query: { url: pdfUrl }
                        });
                        window.open(routeData.href, '_blank');
                    } else {
                        this.$message({ type: 'error', message: '未提交数据!' });
                    }
                })
            } else {
                this.$message({ type: 'error', message: '请选择需要查看核查函的乡!' });

            }

        },


        geDistrictCheck() { //生产者补贴区级核查函
            this.$router.push('/agricultureProcess/districtCheck')
        },
        geDisRequestDan() {
            this.$router.push({
                path: '/agricultureProcess/districtRequest',
                query: {
                    checkType: '高蛋白大豆补贴'
                }
            })
        },
        geDisRequestYou() {
            this.$router.push({
                path: '/agricultureProcess/districtRequest',
                query: {
                    checkType: '高油大豆补贴'
                }
            })
        },
        geDistrictCheckFarm() {
            this.$router.push('/agricultureProcess/districtCheckFarm')
        },
        geDistrictCheckCropFarm() {
            this.$router.push('/agricultureProcess/districtCheckCropFarm')
        },

        geTownCheck() {   //生产者补贴乡级核查函
            this.$router.push('/agricultureProcess/townCheck')
        },

        geTownCheckFarm() { //生成耕地地力乡级核查函
            this.$router.push('/agricultureProcess/townCheckFarm')
        },
        geTownCheckCropFarm() { //生成耕地轮作乡级核查函
            this.$router.push('/agricultureProcess/townCheckCropFarm')
        },
        geTownRequestDan() { //生成大豆高油高蛋白大豆乡级核查函
            this.$router.push({
                path: '/agricultureProcess/townRequest',
                query: {
                    checkType: '高蛋白大豆补贴'
                }
            })
        },
        geTownRequestYou() { //生成大豆高油高蛋白大豆乡级核查函
            this.$router.push({
                path: '/agricultureProcess/townRequest',
                query: {
                    checkType: '高油大豆补贴'
                }
            })
        },


        /** 查询补贴申请列表 */
        getList() {
            this.tableLoading = true;
            this.list = []
            // console.log("查询表单", this.queryParams);
            listProduce(this.queryParams).then(response => {
                // console.log("补贴列表", response);
                this.total = response.total; // 总条数
                this.quanbutotal = response.quanbutotal; //总条数
                this.yichangtotal = response.yichangtotal;  //异常总条数
                this.daichutotal = response.daichutotal;   //待处理条数
                this.yichulitotal = response.yichulitotal;  //已处理条数
                this.shenhetotal = response.shenhetotal;   //审核中条数
                this.sumData = response;

                console.log("汇总数据", this.sumData)

                this.list = response.rows;  //列表数据
                this.tableLoading = false;
            });
        },
        /** 搜索按钮操作 */
        handleQuery() {
            // console.log("当前选择的状态",this.status);
            this.queryParams.statusShow = this.selectStatus === '全部' ? undefined : this.selectStatus;
            this.pageNum = 1;
            this.getList();
        },
        /** 重置按钮操作 */
        resetQuery() {
            this.resetForm("queryFormRef");
            this.handleQuery();
        },
        // 查看生产者
        deleteProduce(row) {
            console.log("查看生产者", row)
            const id = row.id;
            delSubsidyApplication(id).then(res=>{
                if(res.code === 200){
                    this.$modal.msgSuccess("删除成功");
                }
            })
        },
        // 查看生产者
        updateProduce(row) {
            console.log("查看生产者", row)
            const id = row.id;
            this.$router.push("/agricultureApply/produce-app/" + id);
        },
        //查看耕地地力
        updateFarmland(row) {
            console.log("查看耕地地力", row)
            const id = row.id;
            this.$router.push("/agricultureApply/farmland-app/" + id);
        },
        //查看耕地轮作
        updateCropFarmland(row) {
            console.log("查看耕地轮作", row)
            const id = row.id;
            this.$router.push("/agricultureApply/cropfarmland-app/" + id);
        },
        // 查看高油大豆
        updateOilsoy(row) {
            // this.resetForm("rejProsoyForm");
            const id = row.id;
            this.$router.push("/agricultureApply/oilsoy-app/" + id);
        },
        // 查看高蛋白大豆
        updateProsoy(row) {
            // this.resetForm("rejProsoyForm");
            const id = row.id;
            this.$router.push("/agricultureApply/prosoy-app/" + id);
        },

        handlePreview(file) {
            const serveIpPort = "111.40.188.220";
            let originalUrl = '';
            if (Object.keys(file).includes('url')) {
                originalUrl = file.url;
            } else {
                originalUrl = file.response.data.filePath;
            }

            const fileUrl = originalUrl.replace(/http:\/\/[\d.]+/, `http://${serveIpPort}`);
            window.open(fileUrl);
        },
        handleExceed(files, fileList) {
            this.$message.warning(`当前限制选择 1 个文件，请删除现有文件后再选择新文件！`);
        },
    }
}
</script>
    
<style scoped>
.green-line {
    width: 100%;
    height: 2px;
    background-color: rgb(163, 215, 30);
    /* margin: 0 10px; */
}

.app-container {
    background-color: white !important;
}

.card-container {
    background: white;
}

.el-row {
    margin-bottom: 5px;

    &:last-child {
        margin-bottom: 0;
    }
}

.el-radio-button {
    margin: 0;

    .el-radio-button__inner {
        background: rgba(129, 179, 55, 0.2);
        border-radius: 4px;
        color: rgba(51, 51, 51, 1);
    }
}

/* 使用 gap 分隔按钮 */
.custom-radio-group .el-radio-button+.el-radio-button {
    margin-left: 10px;
    border-radius: 4px;
}

.el-select {
    .el-input__inner {
        width: 120px;
    }
}

.typeDiv {
    .el-input__inner {
        width: 160px;
    }
}

.el-scrollbar {
    height: 120px;
}


.card-container {
    position: relative;
    width: 90%;
    align-items: center;
    margin-left: 5%;
    padding-bottom: 20px;
}

.infoDiv {
    width: 100%;
    align-items: center;
    border-radius: 8px;
    box-shadow: 0 2px 12px 0 rgba(0, 0, 0, 0.1);
    margin-top: 20px;
    padding-top: 20px;
}

.corner-label {
    position: absolute;
    top: 0;
    left: 0;
    background: #81B337;
    /* 背景色 */
    color: white;
    /* 文字颜色 */
    padding: 2px 8px;
    /* 内边距 */
    font-size: 20px;
    /* 字体大小 */
    border-radius: 4px;
    /* 圆角，左上角和右下角有圆角（根据需求调整） */
    transform: translate(-10%, -10%);
    /* 微调位置，使其覆盖在圆角上 */
    /* 如果需要，可以设置z-index */
    z-index: 1;
}

.demo-drawer__content {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;

}

::v-deep .demo-drawer .el-drawer__header {
    text-align: center;
    padding: 20px 0;
}


.demo-drawer__footer {
    align-items: center;
    text-align: center;
    margin-bottom: 20px;
}
</style>
    